package com.xrui.hbase.compression;

import java.io.IOException;

/**
 * Implements a CompressionProvider without any compression.
 */
public class NoneCompressionProvider implements CompressionProvider {
    public static final String PROVIDER_NAME = "none_compression";

    /**
     * {@inheritDoc}
     */
    @Override
    public byte[] compress(byte[] data) throws IOException {
        return data.clone();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public byte[] decompress(byte[] compressedData) throws IOException {
        return compressedData.clone();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getName() {
        return PROVIDER_NAME;
    }
}
